package ru.spb.osll.myfit.client.dialog;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;

public class RunSuiteDialog extends InputDialog {

  public RunSuiteDialog(DialogEventListener listener) {
    super(listener);
    setText("Enter comment for test run (optional):");
    defineItems();
  }

  public void defineItems() {
    m_cbButtonOk.setText("Run");

    m_cbButtonOk.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        String inputText = m_suggestBox.getText().trim();
        m_listener.onOK(inputText, m_sourceEvent);
        hide();
        m_sourceEvent = null;
      }
    });
  }
}
